package com.gzk.feignClients;

import com.gzk.domain.Product;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ProductFeingnFallbackFactory implements FallbackFactory<ProductFeign> {
    @Override
    public ProductFeign create(Throwable throwable) {
        return new ProductFeign() {
            @Override
            public Product get(Long id) {
                System.out.println("================================");
                Product product = new Product();
                product.setId(-1L);
                product.setName("出错了1");
                return product;
            }
        };
    }
}
